﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ADSync.EngineComponents
{
	/// <summary>
	/// Class for object mappings
	/// Represents mapped objects from ObjectSid(s) and DistinguishedName(s)
	/// </summary>
	public class Mappings : IDisposable
	{
		#region Preferences

		private bool bDisposed;
		public Dictionary<String, Mapped> ObjectSids
		{
			get;
			set;
		}

		public Dictionary<String, Mapped> DistinguishedNames
		{
			get;
			set;
		}

		public Dictionary<String, Mapped> SaAMAccountNames
		{
			get;
			set;
		}

		public Dictionary<String, String> DN2SID
		{
			get;
			set;
		}

		public Dictionary<String, String> DN2SAM
		{
			get;
			set;
		}

		#endregion

		#region Constructors
		public Mappings()
		{
			this.ObjectSids = new Dictionary<string, Mapped>(StringComparer.OrdinalIgnoreCase);
			this.DistinguishedNames = new Dictionary<string, Mapped>(StringComparer.OrdinalIgnoreCase);

			this.DN2SID = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
			this.SID2DN = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
		}
		#endregion

		#region IDisposable Members
		public void Dispose()
		{
			Dispose(true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool bDisposing)
		{
			if (!this.bDisposed)
			{
				if (bDisposing)
				{
				}

				this.bDisposed = true;
			}
		}

		#endregion
	}
}
